﻿using System.Collections.Generic;
using System.Data;
using System.Reflection;
using System.Threading.Tasks;
namespace Gaea
{
    public interface IGaeaAdapter
    {
        string FindByIdCommandText(out string keyName, string name, string key);

        string FindAllCommandText(string name);

        string InsertCommandText(string name, List<PropertyInfo> columnProperties);

        int Insert(IDbConnection connection, IDbTransaction transaction, string commandText, object entityToInsert, int? commandTimeout);

        Task<int> InsertAsync(IDbConnection connection, IDbTransaction transaction, string commandText, object entityToInsert, int? commandTimeout);

        string UpdateCommandText(string name, List<PropertyInfo> columnProperties, List<PropertyInfo> keyProperties);

        string DeleteCommandText(string name, List<PropertyInfo> keyProperties);

        string DeleteAllCommandText(string name, bool keyRestart);
    }
}
